<?php
/*
 * Created on Feb 7, 2010
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
	if (substr(phpversion(),0,1) == 5)
	{
		include_once($PathPrefix."vendors/secureurl/secureURL.php");
	}
	else
	{
		include_once($PathPrefix."vendors/secureurl/secureURL_php4.php");
	}
	
	class URL_Parser_JavaScript extends URL_Parser
	{
		var $js = "javascript:gotopage";
		
		function isReadable($text)
		{
			if (strtolower(substr($text,0,strlen($this->js))) == $this->js)
			{
				return true;
			}
			
			return false;
		}
		
		function Read($text)
		{
			$url = substr($text,strlen($this->js) + 2); // ("
			$url = substr($url,0,strlen($url) - 3); // ");
			
			$url = str_replace("\\\"","\"",$url);
			$url = str_replace("\\'","'",$url);
			$url = html_entity_decode($url);
			
			return $url;
		}
		
		function Render($url)
		{
			$url = addslashes($url);
			
			return $this->js . "('" . $url . "');";
		}
	}

	SecureURL::setFilterIncludeOption(true); //Encode the URL when no filter matches it
	SecureURL::addFilter(new URL_Filter_Simple("google.com",null,true,false)); //remove google from list
	SecureURL::addParser(new URL_Parser_JavaScript());
	SecureURL::Initialize(new URL_Encoder_Base64());
	
 ?>